 	window.onload=function(){           
       getMyTime();
       barner();
       snapMyTime();
    }
//logo中倒计时
    //1.前面补0
    function p(n){
        return n<10?'0'+n:n;
    }
    //2.倒计时
    function getMyTime(){           
        var startDate=new Date();//获取当前时间
        var endDate=new Date('2017/2/22 00:00:00');//倒计时结束时间
        //获取当前时间与结束时间的时间差
        var countDown=(endDate.getTime()-startDate.getTime())/1000; 
        //var day=parseInt(countDown/(24*60*60));
        var h=parseInt(countDown/(60*60)%24);
        var m=parseInt(countDown/60%60);
        var s=parseInt(countDown%60);
        document.getElementById('time').innerHTML=p(h)+"小时"+p(m)+"分"+p(s)+"秒";
        setTimeout('getMyTime()',1000);
        if(countDown<=0){
          document.getElementById('time').innerHTML="活动结束"; 
        }
    }
//热门商品的滚动
    function barner(){  
 		var mybarner = document.getElementById('hot-barner')
      	var myanniu = document.getElementById("hot-float")
        var myleft = document.getElementById("hot-barner-pic-left");
        var myright = document.getElementById("hot-barner-pic-right");
      	//鼠标移入
        mybarner.onmouseover=function(){
            myanniu.style.display = 'block';
        } 
        //鼠标移出
        mybarner.onmouseout=function(){
            myanniu.style.display = 'none';
        }
    }
//限时抢购商品
    //1.前面补0
    function snap(n){
        return n<10?'0'+n:n;
    }
    //2.倒计时
    function snapMyTime(){           
        var nowDate=new Date();//获取当前时间
        var endDate=new Date('2017/2/22 00:00:00');//倒计时结束时间
        //获取当前时间与结束时间的时间差
        var snapDown=(endDate.getTime()-nowDate.getTime())/1000; 
        //var day=parseInt(snapDown/(24*60*60));
        var h=parseInt(snapDown/(60*60)%24);
        var m=parseInt(snapDown/60%60);
        var s=parseInt(snapDown%60);
        document.getElementById('snap-time').innerHTML="还有"+snap(h)+"小时"+snap(m)+"分"+snap(s)+"秒结束";
        document.getElementById('snap-time-1').innerHTML="还有"+snap(h)+"小时"+snap(m)+"分"+snap(s)+"秒结束";
        document.getElementById('snap-time-2').innerHTML="还有"+snap(h)+"小时"+snap(m)+"分"+snap(s)+"秒结束";
        document.getElementById('snap-time-3').innerHTML="还有"+snap(h)+"小时"+snap(m)+"分"+snap(s)+"秒结束";
        setTimeout('snapMyTime()',1000);
        if(snapDown<=0){
            document.getElementById('snap-time').innerHTML="活动结束";
            document.getElementById('snap-time-1').innerHTML="活动结束";
            document.getElementById('snap-time-2').innerHTML="活动结束";
            document.getElementById('snap-time-3').innerHTML="活动结束";
        }
    }